/*
 *INFO:
 *	the definition of fib,the table structure
 *Author:
 * 	Mark on 2014/4/2
 * 	<mark199312@gmail.com>
 */


#ifndef IP_TABLE_H
#define IP_TABLE_H


#include"uthash.h"
#include<stdio.h>
#include<stdlib.h>
#include"use_hash.h"

struct fib
{
	record_key_t key;

	struct sockaddr_in *node;
	long start_time;

	UT_hash_handle hh;
};

/*Exported by ip_table.c*/

extern void Fib_add_hash(struct fib **head,struct fib *p);

extern struct sockaddr_in * Fib_find_hash(struct fib* head,record_key_t *p);

extern void Fib_delete_hash(struct fib **head,record_key_t *p);

extern int Fib_count_hash(struct fib *head);

extern void Fib_print_fib(struct fib *head);

/*Export by update_fib.c*/
extern void Fib_update_fib(struct fib **head);


#endif
